package com.king.pojo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

//等价于<bean id="user" class="com.king.pojo.User"/>
@Component//注册到spring中,衍生注解@Service @Controller @
@Scope("singleton")//作用域
public class User {
    //注入值
    @Value("king")
    private String name;
}
